 <template>
  <div>1</div>
</template>
<script>
import * as homeApi from "@/server/home.js";
export default {
  layout: "blank",
  data() {
    return {
      html: ""
    };
  },
  methods: {
    gay: function() {
      let dwSafari;
      dwSafari = window.open();
      dwSafari.document.open();
      let dataObj = this.$router.query.data;
      let html = dataObj.replace(/[^\u0000-\u00FF]/g, function($0) {
        return escape($0).replace(/(%u)(\w{4})/gi, "&#x$2;");
      });
      dwSafari.document.write(
        "<html><head><title></title><meta charset='utf-8'><body>" +
          dataObj +
          "</body></html>"
      );
      dwSafari.document.forms[0].submit();
      dwSafari.document.close();
    },
    pay: function() {
      homeApi.pay().then(res => {
        // console.log(res);
        // this.html = res.data;
        // const div = document.createElement("div");
        // div.innerHTML = res.data;
        // document.body.appendChild(div);
        // document.forms.alipaysubmit.submit();
        let dwSafari;
        dwSafari = window.open();
        dwSafari.document.open();
        let dataObj = res.data;
        let html = dataObj.replace(/[^\u0000-\u00FF]/g, function($0) {
          return escape($0).replace(/(%u)(\w{4})/gi, "&#x$2;");
        });
        dwSafari.document.write(
          "<html><head><title></title><meta charset='utf-8'><body>" +
            dataObj +
            "</body></html>"
        );
        dwSafari.document.forms[0].submit();
        dwSafari.document.close();
      });
    }
  },
  mounted() {
    // this.pay();
    this.gay();
  }
};
</script>
